#!/bin/bash

# postinst script for system-test-elftest
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <postinst> \`configure' <most-recently-configured-version>
#        * <old-postinst> \`abort-upgrade' <new version>
#        * <conflictor's-postinst> \`abort-remove' \`in-favour' <package>
#          <new-version>
#        * <postinst> \`abort-remove'
#        * <deconfigured's-postinst> \`abort-deconfigure' \`in-favour'
#          <failed-install-package> <version> \`removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
else
    BASEDIR_OPT="-b $BASEDIR"
fi

case "$1" in
    configure)
	chmod 0444 "$BASEDIR/opt/elf-tests/README"
	chown root:bin "$BASEDIR/opt/elf-tests/README"
	chmod 0444 "$BASEDIR/opt/elf-tests/runfiles/default.run"
	chown root:bin "$BASEDIR/opt/elf-tests/runfiles/default.run"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/assert-deflib/link.c"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/assert-deflib/link.c"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/groups/common.sh"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/common.sh"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/groups/no-relobj-group-merge/README.md"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/no-relobj-group-merge/README.md"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/groups/no-relobj-group-merge/sections.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/no-relobj-group-merge/sections.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/README.md"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/README.md"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-all-sections.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-all-sections.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-one-section.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-one-section.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-two-sections.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-two-sections.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/linker-sets/simple-src.c"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/linker-sets/simple-src.c"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/linker-sets/simple.out"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/linker-sets/simple.out"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.alias-with-others"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.alias-with-others"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.circalias"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.circalias"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.guidance"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.guidance"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.no-extern"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.no-extern"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.no-parent"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.no-parent"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.not-alias"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.not-alias"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.true"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.true"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-alias"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-alias"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-assert"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-assert"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-bind"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-bind"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-shattr"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-shattr"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-type"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.unknown-type"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongalias"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongalias"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongbits"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongbits"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongbits2"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongbits2"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongscope"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongscope"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongsize"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongsize"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongtype"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongtype"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongtype-alias"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongtype-alias"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongtype2"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/mapfile.wrongtype2"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/object.c"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/object.c"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.good"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.good"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.mult"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.mult"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.substring"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.substring"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.superstring"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.superstring"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.wrong"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.addrsize.wrong"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.good"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.good"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.noterm"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.noterm"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.overflow"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.overflow"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.twobegin"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.twobegin"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.wrong"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/mapfile.sizemult.wrong"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/object.c"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/object.c"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/relocs/amd64/gotpcrelx/gotpcrel.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/relocs/amd64/gotpcrelx/gotpcrel.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/relocs/amd64/gotpcrelx/rex_gotpcrel.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/relocs/amd64/gotpcrelx/rex_gotpcrel.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/relocs/i386/got32x/got32x.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/relocs/i386/got32x/got32x.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/Makefile.test"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/Makefile.test"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/README.md"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/README.md"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/access.S"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/access.S"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/hidden.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/hidden.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/main.c"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/main.c"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/visible.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/visible.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/Makefile.test"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/Makefile.test"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/exclude.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/exclude.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/stub.c"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/stub.c"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/string-merge/str1.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/string-merge/str1.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/string-merge/str2.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/string-merge/str2.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/Makefile.test"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/Makefile.test"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style1-func-with-r12.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style1-func-with-r12.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style1-func-with-r13.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style1-func-with-r13.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style1-func.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style1-func.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style1-main.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style1-main.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style2-with-badness.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style2-with-badness.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style2-with-r12.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style2-with-r12.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style2-with-r13.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style2-with-r13.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style2.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/style2.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ld/Makefile.test"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ld/Makefile.test"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ld/ld-with-addend.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ld/ld-with-addend.s"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/i386/ld/Makefile.test"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/i386/ld/Makefile.test"
	chmod 0444 "$BASEDIR/opt/elf-tests/tests/tls/i386/ld/half-ldm.s"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/i386/ld/half-ldm.s"
	chmod 0555 "$BASEDIR/opt/elf-tests/bin/elftest"
	chown root:bin "$BASEDIR/opt/elf-tests/bin/elftest"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/assert-deflib/test-deflib"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/assert-deflib/test-deflib"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/capabilities/objcap"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/capabilities/objcap"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/capabilities/symcap"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/capabilities/symcap"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/groups/no-relobj-group-merge/no-relobj-group-merge"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/no-relobj-group-merge/no-relobj-group-merge"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-all-sections"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-all-sections"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-one-section"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-one-section"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-two-sections"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/groups/strip-groups/strip-two-sections"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/linker-sets/in-use-check"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/linker-sets/in-use-check"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/linker-sets/simple"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/linker-sets/simple"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/test-assert"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/assert/test-assert"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/test-parser"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/mapfiles/parser/test-parser"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/relocs/amd64/gotpcrelx/gotpcrelx"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/relocs/amd64/gotpcrelx/gotpcrelx"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/relocs/amd64/gotpcrelx/rex_gotpcrelx"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/relocs/amd64/gotpcrelx/rex_gotpcrelx"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/relocs/i386/got32x/got32x"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/relocs/i386/got32x/got32x"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/mixed-hidden-comdat"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/resolution/mixed-hidden-comdat/mixed-hidden-comdat"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/exclude-exec"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/exclude-exec"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/exclude-kmod"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/exclude-kmod"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/exclude-so"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/exclude-so"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/include-reloc"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/include-reloc"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/unknown-os"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/sections/shf-exclude/unknown-os"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/string-merge/simple"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/string-merge/simple"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/amd64-ie-test"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ie/amd64-ie-test"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/tls/amd64/ld/amd64-ld-test"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/amd64/ld/amd64-ld-test"
	chmod 0555 "$BASEDIR/opt/elf-tests/tests/tls/i386/ld/i386-ld-test"
	chown root:bin "$BASEDIR/opt/elf-tests/tests/tls/i386/ld/i386-ld-test"
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac



# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

